home *** CD-ROM | disk | FTP | other *** search
/ Oh!X 2000 Spring / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).7z / Oh!X 2000 Spring Special CD-ROM (Japan) (Part 2).bin / DXF / include / dsound.h < prev    next >
C/C++ Source or Header  |  1999-09-08  |  42KB  |  936 lines

  1. /*==========================================================================;
  2.  *
  3.  *  Copyright (C) 1995-1998 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *  File:       dsound.h
  6.  *  Content:    DirectSound include file
  7.  *
  8.  **************************************************************************/
  9.  
  10. #ifndef __DSOUND_INCLUDED__
  11. #define __DSOUND_INCLUDED__
  12.  
  13. #include "d3dtypes.h"
  14.  
  15. #define COM_NO_WINDOWS_H
  16. #include <objbase.h>
  17.  
  18. #define _FACDS  0x878
  19. #define MAKE_DSHRESULT(code)  MAKE_HRESULT(1, _FACDS, code)
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif // __cplusplus
  24.  
  25. #ifndef DIRECTSOUND_VERSION
  26. #define DIRECTSOUND_VERSION  0x0700       /* version 7.0 */
  27. #endif /* !DIRECTSOUND_VERSION */
  28.  
  29.  
  30. // DirectSound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
  31. DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  32.  
  33. // DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
  34. DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  35.  
  36. #ifdef __cplusplus
  37. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  38. struct IDirectSound;
  39. struct IDirectSoundBuffer;
  40. struct IDirectSound3DListener;
  41. struct IDirectSound3DBuffer;
  42. struct IDirectSoundCapture;
  43. struct IDirectSoundCaptureBuffer;
  44. struct IDirectSoundNotify;
  45. #endif // __cplusplus
  46.  
  47. typedef struct IDirectSound *LPDIRECTSOUND;
  48. typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
  49. typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
  50. typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
  51. typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
  52. typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
  53. typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
  54.  
  55. //
  56. // Compatibility typedefs
  57. //
  58.  
  59. #ifndef _LPCWAVEFORMATEX_DEFINED
  60. #define _LPCWAVEFORMATEX_DEFINED
  61. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  62. #endif // _LPCWAVEFORMATEX_DEFINED
  63.  
  64. #ifndef __LPCGUID_DEFINED__
  65. #define __LPCGUID_DEFINED__
  66. typedef const GUID *LPCGUID;
  67. #endif // __LPCGUID_DEFINED__
  68.  
  69. typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
  70. typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
  71. typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
  72. typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
  73. typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
  74. typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
  75. typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
  76.  
  77. //
  78. // Structures
  79. //
  80.  
  81. typedef struct _DSCAPS
  82. {
  83.     DWORD           dwSize;
  84.     DWORD           dwFlags;
  85.     DWORD           dwMinSecondarySampleRate;
  86.     DWORD           dwMaxSecondarySampleRate;
  87.     DWORD           dwPrimaryBuffers;
  88.     DWORD           dwMaxHwMixingAllBuffers;
  89.     DWORD           dwMaxHwMixingStaticBuffers;
  90.     DWORD           dwMaxHwMixingStreamingBuffers;
  91.     DWORD           dwFreeHwMixingAllBuffers;
  92.     DWORD           dwFreeHwMixingStaticBuffers;
  93.     DWORD           dwFreeHwMixingStreamingBuffers;
  94.     DWORD           dwMaxHw3DAllBuffers;
  95.     DWORD           dwMaxHw3DStaticBuffers;
  96.     DWORD           dwMaxHw3DStreamingBuffers;
  97.     DWORD           dwFreeHw3DAllBuffers;
  98.     DWORD           dwFreeHw3DStaticBuffers;
  99.     DWORD           dwFreeHw3DStreamingBuffers;
  100.     DWORD           dwTotalHwMemBytes;
  101.     DWORD           dwFreeHwMemBytes;
  102.     DWORD           dwMaxContigFreeHwMemBytes;
  103.     DWORD           dwUnlockTransferRateHwBuffers;
  104.     DWORD           dwPlayCpuOverheadSwBuffers;
  105.     DWORD           dwReserved1;
  106.     DWORD           dwReserved2;
  107. } DSCAPS, *LPDSCAPS;
  108.  
  109. typedef const DSCAPS *LPCDSCAPS;
  110.  
  111. typedef struct _DSBCAPS
  112. {
  113.     DWORD           dwSize;
  114.     DWORD           dwFlags;
  115.     DWORD           dwBufferBytes;
  116.     DWORD           dwUnlockTransferRate;
  117.     DWORD           dwPlayCpuOverhead;
  118. } DSBCAPS, *LPDSBCAPS;
  119.  
  120. typedef const DSBCAPS *LPCDSBCAPS;
  121.  
  122. typedef struct _DSBUFFERDESC
  123. {
  124.     DWORD           dwSize;
  125.     DWORD           dwFlags;
  126.     DWORD           dwBufferBytes;
  127.     DWORD           dwReserved;
  128.     LPWAVEFORMATEX  lpwfxFormat;
  129. #if DIRECTSOUND_VERSION >= 0x0700
  130.     GUID            guid3DAlgorithm;
  131. #endif
  132. } DSBUFFERDESC, *LPDSBUFFERDESC;
  133.  
  134. typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
  135.  
  136. typedef struct _DSBUFFERDESC1
  137. {
  138.     DWORD           dwSize;
  139.     DWORD           dwFlags;
  140.     DWORD           dwBufferBytes;
  141.     DWORD           dwReserved;
  142.     LPWAVEFORMATEX  lpwfxFormat;
  143. } DSBUFFERDESC1, *LPDSBUFFERDESC1;
  144.  
  145. typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
  146.  
  147. typedef struct _DS3DBUFFER
  148. {
  149.     DWORD           dwSize;
  150.     D3DVECTOR       vPosition;
  151.     D3DVECTOR       vVelocity;
  152.     DWORD           dwInsideConeAngle;
  153.     DWORD           dwOutsideConeAngle;
  154.     D3DVECTOR       vConeOrientation;
  155.     LONG            lConeOutsideVolume;
  156.     D3DVALUE        flMinDistance;
  157.     D3DVALUE        flMaxDistance;
  158.     DWORD           dwMode;
  159. } DS3DBUFFER, *LPDS3DBUFFER;
  160.  
  161. typedef const DS3DBUFFER *LPCDS3DBUFFER;
  162.  
  163. typedef struct _DS3DLISTENER
  164. {
  165.     DWORD           dwSize;
  166.     D3DVECTOR       vPosition;
  167.     D3DVECTOR       vVelocity;
  168.     D3DVECTOR       vOrientFront;
  169.     D3DVECTOR       vOrientTop;
  170.     D3DVALUE        flDistanceFactor;
  171.     D3DVALUE        flRolloffFactor;
  172.     D3DVALUE        flDopplerFactor;
  173. } DS3DLISTENER, *LPDS3DLISTENER;
  174.  
  175. typedef const DS3DLISTENER *LPCDS3DLISTENER;
  176.  
  177. typedef struct _DSCCAPS
  178. {
  179.     DWORD           dwSize;
  180.     DWORD           dwFlags;
  181.     DWORD           dwFormats;
  182.     DWORD           dwChannels;
  183. } DSCCAPS, *LPDSCCAPS;
  184.  
  185. typedef const DSCCAPS *LPCDSCCAPS;
  186.  
  187. typedef struct _DSCBUFFERDESC
  188. {
  189.     DWORD           dwSize;
  190.     DWORD           dwFlags;
  191.     DWORD           dwBufferBytes;
  192.     DWORD           dwReserved;
  193.     LPWAVEFORMATEX  lpwfxFormat;
  194. } DSCBUFFERDESC, *LPDSCBUFFERDESC;
  195.  
  196. typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
  197.  
  198. typedef struct _DSCBCAPS
  199. {
  200.     DWORD           dwSize;
  201.     DWORD           dwFlags;
  202.     DWORD           dwBufferBytes;
  203.     DWORD           dwReserved;
  204. } DSCBCAPS, *LPDSCBCAPS;
  205.  
  206. typedef const DSCBCAPS *LPCDSCBCAPS;
  207.  
  208. typedef struct _DSBPOSITIONNOTIFY
  209. {
  210.     DWORD           dwOffset;
  211.     HANDLE          hEventNotify;
  212. } DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
  213.  
  214. typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
  215.  
  216. //
  217. // DirectSound API
  218. //
  219.  
  220. typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
  221. typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
  222.  
  223. extern HRESULT WINAPI DirectSoundCreate(LPCGUID, LPDIRECTSOUND *, LPUNKNOWN);
  224. extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  225. extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  226.  
  227. extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
  228. extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
  229. extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
  230.  
  231. #ifdef UNICODE
  232. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKW
  233. #define DirectSoundEnumerate        DirectSoundEnumerateW
  234. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
  235. #else // UNICODE
  236. #define LPDSENUMCALLBACK            LPDSENUMCALLBACKA
  237. #define DirectSoundEnumerate        DirectSoundEnumerateA
  238. #define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
  239. #endif // UNICODE
  240.  
  241. //
  242. // IUnknown
  243. //
  244.  
  245. #if !defined(__cplusplus) || defined(CINTERFACE)
  246. #ifndef IUnknown_QueryInterface
  247. #define IUnknown_QueryInterface(p,a,b)  (p)->lpVtbl->QueryInterface(p,a,b)
  248. #endif // IUnknown_QueryInterface
  249. #ifndef IUnknown_AddRef
  250. #define IUnknown_AddRef(p)              (p)->lpVtbl->AddRef(p)
  251. #endif // IUnknown_AddRef
  252. #ifndef IUnknown_Release
  253. #define IUnknown_Release(p)             (p)->lpVtbl->Release(p)
  254. #endif // IUnknown_Release
  255. #else // !defined(__cplusplus) || defined(CINTERFACE)
  256. #ifndef IUnknown_QueryInterface
  257. #define IUnknown_QueryInterface(p,a,b)  (p)->QueryInterface(a,b)
  258. #endif // IUnknown_QueryInterface
  259. #ifndef IUnknown_AddRef
  260. #define IUnknown_AddRef(p)              (p)->AddRef()
  261. #endif // IUnknown_AddRef
  262. #ifndef IUnknown_Release
  263. #define IUnknown_Release(p)             (p)->Release()
  264. #endif // IUnknown_Release
  265. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  266.  
  267. //
  268. // IDirectSound
  269. //
  270.  
  271. DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  272.  
  273. #undef INTERFACE
  274. #define INTERFACE IDirectSound
  275.  
  276. DECLARE_INTERFACE_(IDirectSound, IUnknown)
  277. {
  278.     // IUnknown methods
  279.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  280.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  281.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  282.  
  283.     // IDirectSound methods
  284.     STDMETHOD(CreateSoundBuffer)    (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
  285.     STDMETHOD(GetCaps)              (THIS_ LPDSCAPS) PURE;
  286.     STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
  287.     STDMETHOD(SetCooperativeLevel)  (THIS_ HWND, DWORD) PURE;
  288.     STDMETHOD(Compact)              (THIS) PURE;
  289.     STDMETHOD(GetSpeakerConfig)     (THIS_ LPDWORD) PURE;
  290.     STDMETHOD(SetSpeakerConfig)     (THIS_ DWORD) PURE;
  291.     STDMETHOD(Initialize)           (THIS_ LPCGUID) PURE;
  292. };
  293.  
  294. #define IDirectSound_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  295. #define IDirectSound_AddRef(p)                   IUnknown_AddRef(p)
  296. #define IDirectSound_Release(p)                  IUnknown_Release(p)
  297.  
  298. #if !defined(__cplusplus) || defined(CINTERFACE)
  299. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
  300. #define IDirectSound_GetCaps(p,a)                (p)->lpVtbl->GetCaps(p,a)
  301. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
  302. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
  303. #define IDirectSound_Compact(p)                  (p)->lpVtbl->Compact(p)
  304. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->lpVtbl->GetSpeakerConfig(p,a)
  305. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->lpVtbl->SetSpeakerConfig(p,b)
  306. #define IDirectSound_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
  307. #else // !defined(__cplusplus) || defined(CINTERFACE)
  308. #define IDirectSound_CreateSoundBuffer(p,a,b,c)  (p)->CreateSoundBuffer(a,b,c)
  309. #define IDirectSound_GetCaps(p,a)                (p)->GetCaps(a)
  310. #define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
  311. #define IDirectSound_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
  312. #define IDirectSound_Compact(p)                  (p)->Compact()
  313. #define IDirectSound_GetSpeakerConfig(p,a)       (p)->GetSpeakerConfig(a)
  314. #define IDirectSound_SetSpeakerConfig(p,b)       (p)->SetSpeakerConfig(b)
  315. #define IDirectSound_Initialize(p,a)             (p)->Initialize(a)
  316. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  317.  
  318. //
  319. // IDirectSoundBuffer
  320. //
  321.  
  322. DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  323.  
  324. #undef INTERFACE
  325. #define INTERFACE IDirectSoundBuffer
  326.  
  327. DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
  328. {
  329.     // IUnknown methods
  330.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  331.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  332.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  333.  
  334.     // IDirectSoundBuffer methods
  335.     STDMETHOD(GetCaps)              (THIS_ LPDSBCAPS) PURE;
  336.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD) PURE;
  337.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
  338.     STDMETHOD(GetVolume)            (THIS_ LPLONG) PURE;
  339.     STDMETHOD(GetPan)               (THIS_ LPLONG) PURE;
  340.     STDMETHOD(GetFrequency)         (THIS_ LPDWORD) PURE;
  341.     STDMETHOD(GetStatus)            (THIS_ LPDWORD) PURE;
  342.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
  343.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  344.     STDMETHOD(Play)                 (THIS_ DWORD, DWORD, DWORD) PURE;
  345.     STDMETHOD(SetCurrentPosition)   (THIS_ DWORD) PURE;
  346.     STDMETHOD(SetFormat)            (THIS_ LPCWAVEFORMATEX) PURE;
  347.     STDMETHOD(SetVolume)            (THIS_ LONG) PURE;
  348.     STDMETHOD(SetPan)               (THIS_ LONG) PURE;
  349.     STDMETHOD(SetFrequency)         (THIS_ DWORD) PURE;
  350.     STDMETHOD(Stop)                 (THIS) PURE;
  351.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  352.     STDMETHOD(Restore)              (THIS) PURE;
  353. };
  354.  
  355. #define IDirectSoundBuffer_QueryInterface(p,a,b)        IUnknown_QueryInterface(p,a,b)
  356. #define IDirectSoundBuffer_AddRef(p)                    IUnknown_AddRef(p)
  357. #define IDirectSoundBuffer_Release(p)                   IUnknown_Release(p)
  358.  
  359. #if !defined(__cplusplus) || defined(CINTERFACE)
  360. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
  361. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->lpVtbl->GetCurrentPosition(p,a,b)
  362. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->lpVtbl->GetFormat(p,a,b,c)
  363. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->lpVtbl->GetVolume(p,a)
  364. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->lpVtbl->GetPan(p,a)
  365. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->lpVtbl->GetFrequency(p,a)
  366. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->lpVtbl->GetStatus(p,a)
  367. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
  368. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  369. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->lpVtbl->Play(p,a,b,c)
  370. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->lpVtbl->SetCurrentPosition(p,a)
  371. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->lpVtbl->SetFormat(p,a)
  372. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->lpVtbl->SetVolume(p,a)
  373. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->lpVtbl->SetPan(p,a)
  374. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->lpVtbl->SetFrequency(p,a)
  375. #define IDirectSoundBuffer_Stop(p)                      (p)->lpVtbl->Stop(p)
  376. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->lpVtbl->Unlock(p,a,b,c,d)
  377. #define IDirectSoundBuffer_Restore(p)                   (p)->lpVtbl->Restore(p)
  378. #else // !defined(__cplusplus) || defined(CINTERFACE)
  379. #define IDirectSoundBuffer_GetCaps(p,a)                 (p)->GetCaps(a)
  380. #define IDirectSoundBuffer_GetCurrentPosition(p,a,b)    (p)->GetCurrentPosition(a,b)
  381. #define IDirectSoundBuffer_GetFormat(p,a,b,c)           (p)->GetFormat(a,b,c)
  382. #define IDirectSoundBuffer_GetVolume(p,a)               (p)->GetVolume(a)
  383. #define IDirectSoundBuffer_GetPan(p,a)                  (p)->GetPan(a)
  384. #define IDirectSoundBuffer_GetFrequency(p,a)            (p)->GetFrequency(a)
  385. #define IDirectSoundBuffer_GetStatus(p,a)               (p)->GetStatus(a)
  386. #define IDirectSoundBuffer_Initialize(p,a,b)            (p)->Initialize(a,b)
  387. #define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)        (p)->Lock(a,b,c,d,e,f,g)
  388. #define IDirectSoundBuffer_Play(p,a,b,c)                (p)->Play(a,b,c)
  389. #define IDirectSoundBuffer_SetCurrentPosition(p,a)      (p)->SetCurrentPosition(a)
  390. #define IDirectSoundBuffer_SetFormat(p,a)               (p)->SetFormat(a)
  391. #define IDirectSoundBuffer_SetVolume(p,a)               (p)->SetVolume(a)
  392. #define IDirectSoundBuffer_SetPan(p,a)                  (p)->SetPan(a)
  393. #define IDirectSoundBuffer_SetFrequency(p,a)            (p)->SetFrequency(a)
  394. #define IDirectSoundBuffer_Stop(p)                      (p)->Stop()
  395. #define IDirectSoundBuffer_Unlock(p,a,b,c,d)            (p)->Unlock(a,b,c,d)
  396. #define IDirectSoundBuffer_Restore(p)                   (p)->Restore()
  397. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  398.  
  399. //
  400. // IDirectSound3DListener
  401. //
  402.  
  403. DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  404.  
  405. #undef INTERFACE
  406. #define INTERFACE IDirectSound3DListener
  407.  
  408. DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
  409. {
  410.     // IUnknown methods
  411.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  412.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  413.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  414.  
  415.     // IDirectSound3DListener methods
  416.     STDMETHOD(GetAllParameters)         (THIS_ LPDS3DLISTENER) PURE;
  417.     STDMETHOD(GetDistanceFactor)        (THIS_ LPD3DVALUE) PURE;
  418.     STDMETHOD(GetDopplerFactor)         (THIS_ LPD3DVALUE) PURE;
  419.     STDMETHOD(GetOrientation)           (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
  420.     STDMETHOD(GetPosition)              (THIS_ LPD3DVECTOR) PURE;
  421.     STDMETHOD(GetRolloffFactor)         (THIS_ LPD3DVALUE) PURE;
  422.     STDMETHOD(GetVelocity)              (THIS_ LPD3DVECTOR) PURE;
  423.     STDMETHOD(SetAllParameters)         (THIS_ LPCDS3DLISTENER, DWORD) PURE;
  424.     STDMETHOD(SetDistanceFactor)        (THIS_ D3DVALUE, DWORD) PURE;
  425.     STDMETHOD(SetDopplerFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  426.     STDMETHOD(SetOrientation)           (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  427.     STDMETHOD(SetPosition)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  428.     STDMETHOD(SetRolloffFactor)         (THIS_ D3DVALUE, DWORD) PURE;
  429.     STDMETHOD(SetVelocity)              (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  430.     STDMETHOD(CommitDeferredSettings)   (THIS) PURE;
  431. };
  432.  
  433. #define IDirectSound3DListener_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  434. #define IDirectSound3DListener_AddRef(p)                        IUnknown_AddRef(p)
  435. #define IDirectSound3DListener_Release(p)                       IUnknown_Release(p)
  436.  
  437. #if !defined(__cplusplus) || defined(CINTERFACE)
  438. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->lpVtbl->GetAllParameters(p,a)
  439. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->lpVtbl->GetDistanceFactor(p,a)
  440. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->lpVtbl->GetDopplerFactor(p,a)
  441. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->lpVtbl->GetOrientation(p,a,b)
  442. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->lpVtbl->GetPosition(p,a)
  443. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->lpVtbl->GetRolloffFactor(p,a)
  444. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->lpVtbl->GetVelocity(p,a)
  445. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->lpVtbl->SetAllParameters(p,a,b)
  446. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->lpVtbl->SetDistanceFactor(p,a,b)
  447. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->lpVtbl->SetDopplerFactor(p,a,b)
  448. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
  449. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->lpVtbl->SetPosition(p,a,b,c,d)
  450. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->lpVtbl->SetRolloffFactor(p,a,b)
  451. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  452. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->lpVtbl->CommitDeferredSettings(p)
  453. #else // !defined(__cplusplus) || defined(CINTERFACE)
  454. #define IDirectSound3DListener_GetAllParameters(p,a)            (p)->GetAllParameters(a)
  455. #define IDirectSound3DListener_GetDistanceFactor(p,a)           (p)->GetDistanceFactor(a)
  456. #define IDirectSound3DListener_GetDopplerFactor(p,a)            (p)->GetDopplerFactor(a)
  457. #define IDirectSound3DListener_GetOrientation(p,a,b)            (p)->GetOrientation(a,b)
  458. #define IDirectSound3DListener_GetPosition(p,a)                 (p)->GetPosition(a)
  459. #define IDirectSound3DListener_GetRolloffFactor(p,a)            (p)->GetRolloffFactor(a)
  460. #define IDirectSound3DListener_GetVelocity(p,a)                 (p)->GetVelocity(a)
  461. #define IDirectSound3DListener_SetAllParameters(p,a,b)          (p)->SetAllParameters(a,b)
  462. #define IDirectSound3DListener_SetDistanceFactor(p,a,b)         (p)->SetDistanceFactor(a,b)
  463. #define IDirectSound3DListener_SetDopplerFactor(p,a,b)          (p)->SetDopplerFactor(a,b)
  464. #define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g)  (p)->SetOrientation(a,b,c,d,e,f,g)
  465. #define IDirectSound3DListener_SetPosition(p,a,b,c,d)           (p)->SetPosition(a,b,c,d)
  466. #define IDirectSound3DListener_SetRolloffFactor(p,a,b)          (p)->SetRolloffFactor(a,b)
  467. #define IDirectSound3DListener_SetVelocity(p,a,b,c,d)           (p)->SetVelocity(a,b,c,d)
  468. #define IDirectSound3DListener_CommitDeferredSettings(p)        (p)->CommitDeferredSettings()
  469. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  470.  
  471. //
  472. // IDirectSound3DBuffer
  473. //
  474.  
  475. DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
  476.  
  477. #undef INTERFACE
  478. #define INTERFACE IDirectSound3DBuffer
  479.  
  480. DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
  481. {
  482.     // IUnknown methods
  483.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  484.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  485.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  486.  
  487.     // IDirectSound3DBuffer methods
  488.     STDMETHOD(GetAllParameters)     (THIS_ LPDS3DBUFFER) PURE;
  489.     STDMETHOD(GetConeAngles)        (THIS_ LPDWORD, LPDWORD) PURE;
  490.     STDMETHOD(GetConeOrientation)   (THIS_ LPD3DVECTOR) PURE;
  491.     STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
  492.     STDMETHOD(GetMaxDistance)       (THIS_ LPD3DVALUE) PURE;
  493.     STDMETHOD(GetMinDistance)       (THIS_ LPD3DVALUE) PURE;
  494.     STDMETHOD(GetMode)              (THIS_ LPDWORD) PURE;
  495.     STDMETHOD(GetPosition)          (THIS_ LPD3DVECTOR) PURE;
  496.     STDMETHOD(GetVelocity)          (THIS_ LPD3DVECTOR) PURE;
  497.     STDMETHOD(SetAllParameters)     (THIS_ LPCDS3DBUFFER, DWORD) PURE;
  498.     STDMETHOD(SetConeAngles)        (THIS_ DWORD, DWORD, DWORD) PURE;
  499.     STDMETHOD(SetConeOrientation)   (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  500.     STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
  501.     STDMETHOD(SetMaxDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  502.     STDMETHOD(SetMinDistance)       (THIS_ D3DVALUE, DWORD) PURE;
  503.     STDMETHOD(SetMode)              (THIS_ DWORD, DWORD) PURE;
  504.     STDMETHOD(SetPosition)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  505.     STDMETHOD(SetVelocity)          (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
  506. };
  507.  
  508. #define IDirectSound3DBuffer_QueryInterface(p,a,b)          IUnknown_QueryInterface(p,a,b)
  509. #define IDirectSound3DBuffer_AddRef(p)                      IUnknown_AddRef(p)
  510. #define IDirectSound3DBuffer_Release(p)                     IUnknown_Release(p)
  511.  
  512. #if !defined(__cplusplus) || defined(CINTERFACE)
  513. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->lpVtbl->GetAllParameters(p,a)
  514. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->lpVtbl->GetConeAngles(p,a,b)
  515. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->lpVtbl->GetConeOrientation(p,a)
  516. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->lpVtbl->GetConeOutsideVolume(p,a)
  517. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->lpVtbl->GetPosition(p,a)
  518. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->lpVtbl->GetMinDistance(p,a)
  519. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->lpVtbl->GetMaxDistance(p,a)
  520. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->lpVtbl->GetMode(p,a)
  521. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->lpVtbl->GetVelocity(p,a)
  522. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->lpVtbl->SetAllParameters(p,a,b)
  523. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->lpVtbl->SetConeAngles(p,a,b,c)
  524. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
  525. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
  526. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->lpVtbl->SetPosition(p,a,b,c,d)
  527. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->lpVtbl->SetMinDistance(p,a,b)
  528. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->lpVtbl->SetMaxDistance(p,a,b)
  529. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->lpVtbl->SetMode(p,a,b)
  530. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->lpVtbl->SetVelocity(p,a,b,c,d)
  531. #else // !defined(__cplusplus) || defined(CINTERFACE)
  532. #define IDirectSound3DBuffer_GetAllParameters(p,a)          (p)->GetAllParameters(a)
  533. #define IDirectSound3DBuffer_GetConeAngles(p,a,b)           (p)->GetConeAngles(a,b)
  534. #define IDirectSound3DBuffer_GetConeOrientation(p,a)        (p)->GetConeOrientation(a)
  535. #define IDirectSound3DBuffer_GetConeOutsideVolume(p,a)      (p)->GetConeOutsideVolume(a)
  536. #define IDirectSound3DBuffer_GetPosition(p,a)               (p)->GetPosition(a)
  537. #define IDirectSound3DBuffer_GetMinDistance(p,a)            (p)->GetMinDistance(a)
  538. #define IDirectSound3DBuffer_GetMaxDistance(p,a)            (p)->GetMaxDistance(a)
  539. #define IDirectSound3DBuffer_GetMode(p,a)                   (p)->GetMode(a)
  540. #define IDirectSound3DBuffer_GetVelocity(p,a)               (p)->GetVelocity(a)
  541. #define IDirectSound3DBuffer_SetAllParameters(p,a,b)        (p)->SetAllParameters(a,b)
  542. #define IDirectSound3DBuffer_SetConeAngles(p,a,b,c)         (p)->SetConeAngles(a,b,c)
  543. #define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d)  (p)->SetConeOrientation(a,b,c,d)
  544. #define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)    (p)->SetConeOutsideVolume(a,b)
  545. #define IDirectSound3DBuffer_SetPosition(p,a,b,c,d)         (p)->SetPosition(a,b,c,d)
  546. #define IDirectSound3DBuffer_SetMinDistance(p,a,b)          (p)->SetMinDistance(a,b)
  547. #define IDirectSound3DBuffer_SetMaxDistance(p,a,b)          (p)->SetMaxDistance(a,b)
  548. #define IDirectSound3DBuffer_SetMode(p,a,b)                 (p)->SetMode(a,b)
  549. #define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d)         (p)->SetVelocity(a,b,c,d)
  550. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  551.  
  552. //
  553. // IDirectSoundCapture
  554. //
  555.  
  556. DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  557.  
  558. #undef INTERFACE
  559. #define INTERFACE IDirectSoundCapture
  560.  
  561. DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
  562. {
  563.     // IUnknown methods
  564.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  565.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  566.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  567.  
  568.     // IDirectSoundCapture methods
  569.     STDMETHOD(CreateCaptureBuffer)  (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
  570.     STDMETHOD(GetCaps)              (THIS_ LPDSCCAPS ) PURE;
  571.     STDMETHOD(Initialize)           (THIS_ LPCGUID) PURE;
  572. };
  573.  
  574. #define IDirectSoundCapture_QueryInterface(p,a,b)           IUnknown_QueryInterface(p,a,b)
  575. #define IDirectSoundCapture_AddRef(p)                       IUnknown_AddRef(p)
  576. #define IDirectSoundCapture_Release(p)                      IUnknown_Release(p)
  577.  
  578. #if !defined(__cplusplus) || defined(CINTERFACE)
  579. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
  580. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->lpVtbl->GetCaps(p,a)
  581. #define IDirectSoundCapture_Initialize(p,a)                 (p)->lpVtbl->Initialize(p,a)
  582. #else // !defined(__cplusplus) || defined(CINTERFACE)
  583. #define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c)    (p)->CreateCaptureBuffer(a,b,c)
  584. #define IDirectSoundCapture_GetCaps(p,a)                    (p)->GetCaps(a)
  585. #define IDirectSoundCapture_Initialize(p,a)                 (p)->Initialize(a)
  586. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  587.  
  588. //
  589. // IDirectSoundCaptureBuffer
  590. //
  591.  
  592. DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  593.  
  594. #undef INTERFACE
  595. #define INTERFACE IDirectSoundCaptureBuffer
  596.  
  597. DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
  598. {
  599.     // IUnknown methods
  600.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID *) PURE;
  601.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  602.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  603.  
  604.     // IDirectSoundCaptureBuffer methods
  605.     STDMETHOD(GetCaps)              (THIS_ LPDSCBCAPS ) PURE;
  606.     STDMETHOD(GetCurrentPosition)   (THIS_ LPDWORD, LPDWORD ) PURE;
  607.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
  608.     STDMETHOD(GetStatus)            (THIS_ LPDWORD ) PURE;
  609.     STDMETHOD(Initialize)           (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
  610.     STDMETHOD(Lock)                 (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
  611.     STDMETHOD(Start)                (THIS_ DWORD) PURE;
  612.     STDMETHOD(Stop)                 (THIS) PURE;
  613.     STDMETHOD(Unlock)               (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
  614. };
  615.  
  616. #define IDirectSoundCaptureBuffer_QueryInterface(p,a,b)         IUnknown_QueryInterface(p,a,b)
  617. #define IDirectSoundCaptureBuffer_AddRef(p)                     IUnknown_AddRef(p)
  618. #define IDirectSoundCaptureBuffer_Release(p)                    IUnknown_Release(p)
  619.  
  620. #if !defined(__cplusplus) || defined(CINTERFACE)
  621. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->lpVtbl->GetCaps(p,a)
  622. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->lpVtbl->GetCurrentPosition(p,a,b)
  623. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->lpVtbl->GetFormat(p,a,b,c)
  624. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->lpVtbl->GetStatus(p,a)
  625. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->lpVtbl->Initialize(p,a,b)
  626. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
  627. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->lpVtbl->Start(p,a)
  628. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->lpVtbl->Stop(p)
  629. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->lpVtbl->Unlock(p,a,b,c,d)
  630. #else // !defined(__cplusplus) || defined(CINTERFACE)
  631. #define IDirectSoundCaptureBuffer_GetCaps(p,a)                  (p)->GetCaps(a)
  632. #define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)     (p)->GetCurrentPosition(a,b)
  633. #define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)            (p)->GetFormat(a,b,c)
  634. #define IDirectSoundCaptureBuffer_GetStatus(p,a)                (p)->GetStatus(a)
  635. #define IDirectSoundCaptureBuffer_Initialize(p,a,b)             (p)->Initialize(a,b)
  636. #define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)         (p)->Lock(a,b,c,d,e,f,g)
  637. #define IDirectSoundCaptureBuffer_Start(p,a)                    (p)->Start(a)
  638. #define IDirectSoundCaptureBuffer_Stop(p)                       (p)->Stop()
  639. #define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)             (p)->Unlock(a,b,c,d)
  640. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  641.  
  642. //
  643. // IDirectSoundNotify
  644. //
  645.  
  646. DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
  647.  
  648. #undef INTERFACE
  649. #define INTERFACE IDirectSoundNotify
  650.  
  651. DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
  652. {
  653.     // IUnknown methods
  654.     STDMETHOD(QueryInterface)           (THIS_ REFIID, LPVOID *) PURE;
  655.     STDMETHOD_(ULONG,AddRef)            (THIS) PURE;
  656.     STDMETHOD_(ULONG,Release)           (THIS) PURE;
  657.  
  658.     // IDirectSoundNotify methods
  659.     STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
  660. };
  661.  
  662. #define IDirectSoundNotify_QueryInterface(p,a,b)            IUnknown_QueryInterface(p,a,b)
  663. #define IDirectSoundNotify_AddRef(p)                        IUnknown_AddRef(p)
  664. #define IDirectSoundNotify_Release(p)                       IUnknown_Release(p)
  665.  
  666. #if !defined(__cplusplus) || defined(CINTERFACE)
  667. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->lpVtbl->SetNotificationPositions(p,a,b)
  668. #else // !defined(__cplusplus) || defined(CINTERFACE)
  669. #define IDirectSoundNotify_SetNotificationPositions(p,a,b)  (p)->SetNotificationPositions(a,b)
  670. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  671.  
  672. //
  673. // IKsPropertySet
  674. //
  675.  
  676. #ifndef _IKsPropertySet_
  677. #define _IKsPropertySet_
  678.  
  679. #ifdef __cplusplus
  680. // 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
  681. struct IKsPropertySet;
  682. #endif // __cplusplus
  683.  
  684. typedef struct IKsPropertySet *LPKSPROPERTYSET;
  685.  
  686. #define KSPROPERTY_SUPPORT_GET  0x00000001
  687. #define KSPROPERTY_SUPPORT_SET  0x00000002
  688.  
  689. DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
  690.  
  691. #undef INTERFACE
  692. #define INTERFACE IKsPropertySet
  693.  
  694. DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
  695. {
  696.     // IUnknown methods
  697.     STDMETHOD(QueryInterface)   (THIS_ REFIID, LPVOID *) PURE;
  698.     STDMETHOD_(ULONG,AddRef)    (THIS) PURE;
  699.     STDMETHOD_(ULONG,Release)   (THIS) PURE;
  700.  
  701.     // IKsPropertySet methods
  702.     STDMETHOD(Get)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
  703.     STDMETHOD(Set)              (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
  704.     STDMETHOD(QuerySupport)     (THIS_ REFGUID, ULONG, PULONG) PURE;
  705. };
  706.  
  707. #define IKsPropertySet_QueryInterface(p,a,b)       IUnknown_QueryInterface(p,a,b)
  708. #define IKsPropertySet_AddRef(p)                   IUnknown_AddRef(p)
  709. #define IKsPropertySet_Release(p)                  IUnknown_Release(p)
  710.  
  711. #if !defined(__cplusplus) || defined(CINTERFACE)
  712. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
  713. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->lpVtbl->Set(p,a,b,c,d,e,f)
  714. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->lpVtbl->QuerySupport(p,a,b,c)
  715. #else // !defined(__cplusplus) || defined(CINTERFACE)
  716. #define IKsPropertySet_Get(p,a,b,c,d,e,f,g)        (p)->Get(a,b,c,d,e,f,g)
  717. #define IKsPropertySet_Set(p,a,b,c,d,e,f)          (p)->Set(a,b,c,d,e,f)
  718. #define IKsPropertySet_QuerySupport(p,a,b,c)       (p)->QuerySupport(a,b,c)
  719. #endif // !defined(__cplusplus) || defined(CINTERFACE)
  720.  
  721. #endif // _IKsPropertySet_
  722.  
  723.  
  724. //
  725. // Return Codes
  726. //
  727.  
  728. // The function completed successfully
  729. #define DS_OK                           S_OK
  730.  
  731. // The function completed successfully, but we had to substitute the 3D algorithm
  732. #define DS_NO_VIRTUALIZATION            MAKE_HRESULT(0, _FACDS, 10)
  733.  
  734. // The call failed because resources (such as a priority level)
  735. // were already being used by another caller
  736. #define DSERR_ALLOCATED                 MAKE_DSHRESULT(10)
  737.  
  738. // The control (vol,pan,etc.) requested by the caller is not available
  739. #define DSERR_CONTROLUNAVAIL            MAKE_DSHRESULT(30)
  740.  
  741. // An invalid parameter was passed to the returning function
  742. #define DSERR_INVALIDPARAM              E_INVALIDARG
  743.  
  744. // This call is not valid for the current state of this object
  745. #define DSERR_INVALIDCALL               MAKE_DSHRESULT(50)
  746.  
  747. // An undetermined error occured inside the DirectSound subsystem
  748. #define DSERR_GENERIC                   E_FAIL
  749.  
  750. // The caller does not have the priority level required for the function to
  751. // succeed
  752. #define DSERR_PRIOLEVELNEEDED           MAKE_DSHRESULT(70)
  753.  
  754. // Not enough free memory is available to complete the operation
  755. #define DSERR_OUTOFMEMORY               E_OUTOFMEMORY
  756.  
  757. // The specified WAVE format is not supported
  758. #define DSERR_BADFORMAT                 MAKE_DSHRESULT(100)
  759.  
  760. // The function called is not supported at this time
  761. #define DSERR_UNSUPPORTED               E_NOTIMPL
  762.  
  763. // No sound driver is available for use
  764. #define DSERR_NODRIVER                  MAKE_DSHRESULT(120)
  765.  
  766. // This object is already initialized
  767. #define DSERR_ALREADYINITIALIZED        MAKE_DSHRESULT(130)
  768.  
  769. // This object does not support aggregation
  770. #define DSERR_NOAGGREGATION             CLASS_E_NOAGGREGATION
  771.  
  772. // The buffer memory has been lost, and must be restored
  773. #define DSERR_BUFFERLOST                MAKE_DSHRESULT(150)
  774.  
  775. // Another app has a higher priority level, preventing this call from
  776. // succeeding
  777. #define DSERR_OTHERAPPHASPRIO           MAKE_DSHRESULT(160)
  778.  
  779. // This object has not been initialized
  780. #define DSERR_UNINITIALIZED             MAKE_DSHRESULT(170)
  781.  
  782. // The requested COM interface is not available
  783. #define DSERR_NOINTERFACE               E_NOINTERFACE
  784.  
  785. // Access is denied
  786. #define DSERR_ACCESSDENIED              E_ACCESSDENIED
  787.  
  788. //
  789. // Flags
  790. //
  791.  
  792. #define DSCAPS_PRIMARYMONO          0x00000001
  793. #define DSCAPS_PRIMARYSTEREO        0x00000002
  794. #define DSCAPS_PRIMARY8BIT          0x00000004
  795. #define DSCAPS_PRIMARY16BIT         0x00000008
  796. #define DSCAPS_CONTINUOUSRATE       0x00000010
  797. #define DSCAPS_EMULDRIVER           0x00000020
  798. #define DSCAPS_CERTIFIED            0x00000040
  799. #define DSCAPS_SECONDARYMONO        0x00000100
  800. #define DSCAPS_SECONDARYSTEREO      0x00000200
  801. #define DSCAPS_SECONDARY8BIT        0x00000400
  802. #define DSCAPS_SECONDARY16BIT       0x00000800
  803.  
  804. #define DSSCL_NORMAL                0x00000001
  805. #define DSSCL_PRIORITY              0x00000002
  806. #define DSSCL_EXCLUSIVE             0x00000003
  807. #define DSSCL_WRITEPRIMARY          0x00000004
  808.  
  809. #define DSSPEAKER_HEADPHONE         0x00000001
  810. #define DSSPEAKER_MONO              0x00000002
  811. #define DSSPEAKER_QUAD              0x00000003
  812. #define DSSPEAKER_STEREO            0x00000004
  813. #define DSSPEAKER_SURROUND          0x00000005
  814. #define DSSPEAKER_5POINT1           0x00000006
  815.  
  816. #define DSSPEAKER_GEOMETRY_MIN      0x00000005  //   5 degrees
  817. #define DSSPEAKER_GEOMETRY_NARROW   0x0000000A  //  10 degrees
  818. #define DSSPEAKER_GEOMETRY_WIDE     0x00000014  //  20 degrees
  819. #define DSSPEAKER_GEOMETRY_MAX      0x000000B4  // 180 degrees
  820.  
  821. #define DSSPEAKER_COMBINED(c, g)    ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
  822. #define DSSPEAKER_CONFIG(a)         ((BYTE)(a))
  823. #define DSSPEAKER_GEOMETRY(a)       ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
  824.  
  825. #define DSBCAPS_PRIMARYBUFFER       0x00000001
  826. #define DSBCAPS_STATIC              0x00000002
  827. #define DSBCAPS_LOCHARDWARE         0x00000004
  828. #define DSBCAPS_LOCSOFTWARE         0x00000008
  829. #define DSBCAPS_CTRL3D              0x00000010
  830. #define DSBCAPS_CTRLFREQUENCY       0x00000020
  831. #define DSBCAPS_CTRLPAN             0x00000040
  832. #define DSBCAPS_CTRLVOLUME          0x00000080
  833. #define DSBCAPS_CTRLPOSITIONNOTIFY  0x00000100
  834. #define DSBCAPS_STICKYFOCUS         0x00004000
  835. #define DSBCAPS_GLOBALFOCUS         0x00008000
  836. #define DSBCAPS_GETCURRENTPOSITION2 0x00010000
  837. #define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
  838. #define DSBCAPS_LOCDEFER            0x00040000
  839.  
  840. #define DSBPLAY_LOOPING             0x00000001
  841. #define DSBPLAY_LOCHARDWARE         0x00000002
  842. #define DSBPLAY_LOCSOFTWARE         0x00000004
  843. #define DSBPLAY_TERMINATEBY_TIME    0x00000008
  844. #define DSBPLAY_TERMINATEBY_DISTANCE    0x000000010
  845. #define DSBPLAY_TERMINATEBY_PRIORITY    0x000000020
  846.  
  847. #define DSBSTATUS_PLAYING           0x00000001
  848. #define DSBSTATUS_BUFFERLOST        0x00000002
  849. #define DSBSTATUS_LOOPING           0x00000004
  850. #define DSBSTATUS_LOCHARDWARE       0x00000008
  851. #define DSBSTATUS_LOCSOFTWARE       0x00000010
  852. #define DSBSTATUS_TERMINATED        0x00000020
  853.  
  854. #define DSBLOCK_FROMWRITECURSOR     0x00000001
  855. #define DSBLOCK_ENTIREBUFFER        0x00000002
  856.  
  857. #define DSBFREQUENCY_MIN            100
  858. #define DSBFREQUENCY_MAX            100000
  859. #define DSBFREQUENCY_ORIGINAL       0
  860.  
  861. #define DSBPAN_LEFT                 -10000
  862. #define DSBPAN_CENTER               0
  863. #define DSBPAN_RIGHT                10000
  864.  
  865. #define DSBVOLUME_MIN               -10000
  866. #define DSBVOLUME_MAX               0
  867.  
  868. #define DSBSIZE_MIN                 4
  869. #define DSBSIZE_MAX                 0x0FFFFFFF
  870.  
  871. #define DS3DMODE_NORMAL             0x00000000
  872. #define DS3DMODE_HEADRELATIVE       0x00000001
  873. #define DS3DMODE_DISABLE            0x00000002
  874.  
  875. #define DS3D_IMMEDIATE              0x00000000
  876. #define DS3D_DEFERRED               0x00000001
  877.  
  878. #define DS3D_MINDISTANCEFACTOR      FLT_MIN
  879. #define DS3D_MAXDISTANCEFACTOR      FLT_MAX
  880. #define DS3D_DEFAULTDISTANCEFACTOR  1.0f
  881.  
  882. #define DS3D_MINROLLOFFFACTOR       0.0f
  883. #define DS3D_MAXROLLOFFFACTOR       10.0f
  884. #define DS3D_DEFAULTROLLOFFFACTOR   1.0f
  885.  
  886. #define DS3D_MINDOPPLERFACTOR       0.0f
  887. #define DS3D_MAXDOPPLERFACTOR       10.0f
  888. #define DS3D_DEFAULTDOPPLERFACTOR   1.0f
  889.  
  890. #define DS3D_DEFAULTMINDISTANCE     1.0f
  891. #define DS3D_DEFAULTMAXDISTANCE     1000000000.0f
  892.  
  893. #define DS3D_MINCONEANGLE           0
  894. #define DS3D_MAXCONEANGLE           360
  895. #define DS3D_DEFAULTCONEANGLE       360
  896.  
  897. #define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
  898.  
  899. #define DSCCAPS_EMULDRIVER          DSCAPS_EMULDRIVER
  900. #define DSCCAPS_CERTIFIED           DSCAPS_CERTIFIED
  901.  
  902. #define DSCBCAPS_WAVEMAPPED         0x80000000
  903.  
  904. #define DSCBLOCK_ENTIREBUFFER       0x00000001
  905.  
  906. #define DSCBSTATUS_CAPTURING        0x00000001
  907. #define DSCBSTATUS_LOOPING          0x00000002
  908.  
  909. #define DSCBSTART_LOOPING           0x00000001
  910.  
  911. #define DSBPN_OFFSETSTOP            0xFFFFFFFF
  912.  
  913.  
  914. //
  915. // DirectSound3D Algorithms
  916. //
  917.  
  918. // Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
  919. #define DS3DALG_DEFAULT GUID_NULL
  920.  
  921. // No virtualization {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
  922. DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  923.  
  924. // High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
  925. DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  926.  
  927. // Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
  928. DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
  929.  
  930. #ifdef __cplusplus
  931. };
  932. #endif // __cplusplus
  933.  
  934. #endif  // __DSOUND_INCLUDED__
  935.  
  936.